<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>九九乘法表</title>
<style>
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
  }
  .table {
    display: table;
    border-collapse: collapse;
    margin: auto;
  }
  .table td {
    border: 1px solid blue;
    text-align: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  .table td:hover {
    background-color: blue; /* 鼠标悬停时的背景色 */
    color: #00796b; /* 鼠标悬停时的文字颜色，可选 */
  }
</style>
</head>
<body>
<div class="table">
  <table id="multiplicationTable">
    <tbody>
    </tbody>
  </table>
</div>

<script>
  function generateMultiplicationTable() {
    const tableBody = document.getElementById('multiplicationTable').getElementsByTagName('tbody')[0];
    for (let i = 1; i <= 9; i++) {
      const row = document.createElement('tr');
      for (let j = 1; j <= i; j++) {
        const cell = document.createElement('td');
        cell.textContent = `${j}x${i}=${j * i}`;
        row.appendChild(cell);
      }
      tableBody.appendChild(row);
    }
  }

  window.onload = generateMultiplicationTable;
</script>
</body>
</html>